package atm05;

import atm04.Users;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

/**
 * 查询界面
 */
public class SearchPanel extends JPanel implements ActionListener{
    private ATM05 atm05;
    private JLabel balance = new JLabel("您的余额为：");
    private JLabel money = new JLabel();
    private JButton exit = new JButton(new ImageIcon("src/atm05/Images/buttonOff.jpg"));
    private Font font = new Font("黑体",Font.BOLD,25);
    private Font font02 = new Font("黑体",Font.BOLD,30);

    public SearchPanel(ATM05 atm05) {
        this.atm05 = atm05;
        this.setLayout(null);

        balance.setBounds(300,250,250,50);
        balance.setFont(font);

        money.setBounds(470,250,200,50);
        money.setFont(font02);


        exit.setBounds(880,380,140,50);
        exit.addActionListener(this);

        this.add(balance);
        this.add(exit);
        this.add(money);

        this.setOpaque(false);
    }
    public void showBlance(){
        money.setText(atm05.getLoginUser().getBlance() + "");
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        atm05.showPanel("menu");
    }


}
